import baseModules from "@/components/materals/base";
export const CONFIG = [...baseModules.list];
export const COMS_JSON = { ...baseModules.json };
import { getModules } from "@/utils";
//业务组件注册
const business = getModules(
  require.context("low_code_base_pub_merch/components/business", true, /\.vue$/)
);
//基础组件注册
const basic = getModules(
  require.context("low_code_base_pub_merch/components/basic", true, /\.vue$/)
);
//自定义表单注册
const cus_form = getModules(
  require.context("low_code_base_pub_merch/components/cus-form", true, /\.vue$/)
);
//唯一组件注册
const only = getModules(
  require.context("low_code_base_pub_merch/components/only", true, /\.vue$/)
);

//其他组件注册
const other = getModules(
  require.context("low_code_base_pub_merch/components/other", true, /\.vue$/)
);
const modules = { ...business, ...basic, ...cus_form, ...only, ...other };
console.log("===modules===", modules);

const install = (app) => {
  Object.keys(modules).map((v) => {
    const component = modules[v];
    app.component(component.name, component);
  });
};
export default {
  install,
  ...modules,
};
